package org.csu.mypetstorems.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class Item {
    @TableId(value = "itemid")
    @NotEmpty(message = "itemid不能为空")
//    @Pattern(regexp = "^[A-Za-z0-9]{2,10}$")
    private String itemId;

    @TableField(value = "productid")
    @NotEmpty(message = "productid不能为空")
    private String productId;

    @TableField(value = "listprice")
    @NotNull(message = "单价不能为空")
//    @Pattern(regexp = "^\\d{1,10}$")
    private BigDecimal listPrice;

    @TableField(value = "unitcost")
    @NotNull(message = "成本价不能为空")
//    @Pattern(regexp = "^\\d{1,10}$")
    private BigDecimal unitCost;

    @TableField(value = "supplierid")
    @NotNull(message = "供应商不能为空")
    private int supplierId;
    @TableField(value = "status")
    @NotEmpty(message = "状态不能为空")
    private String status;

    @TableField(value = "attribute1")
    @NotEmpty(message = "属性不能为空")
    @Pattern(regexp = "^.{1,30}$")
    private String attribute1;
    @TableField(value = "img")
    @NotEmpty(message = "图片不能为空")
    private String img;

    @TableField(value = "qty")
//    @NotEmpty(message = "库存")
    private int qty;
}
